<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>SemOpt: src/SetArguments.cpp Source File</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>


</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">SemOpt
   &#160;<span id="projectnumber">0.2alpha5-SCC</span>
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.6.1 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>File&#160;Members</span></a></li>
    </ul>
  </div>
</div>
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
  initNavTree('SetArguments_8cpp.html','');
</script>
<div id="doc-content">
<div class="header">
  <div class="headertitle">
<div class="title">src/SetArguments.cpp</div>  </div>
</div><!--header-->
<div class="contents">
<a href="SetArguments_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 
<a name="l00009"></a>00009 <span class="preprocessor">#include &quot;SetArguments.h&quot;</span>
<a name="l00010"></a>00010 
<a name="l00014"></a><a class="code" href="classSetArguments.html#acbba23977f0c9fc09a827b0b1c9df7a3">00014</a> <a class="code" href="classSetArguments.html#acbba23977f0c9fc09a827b0b1c9df7a3" title="Simple constructor.">SetArguments::SetArguments</a>()
<a name="l00015"></a>00015 {
<a name="l00016"></a>00016         this-&gt;<a class="code" href="classSetArguments.html#aaae0e0a7aeffe21d3ec1e0254f4bf364">arguments</a> = map&lt;string, Argument *&gt;();
<a name="l00017"></a>00017         this-&gt;<a class="code" href="classSetArguments.html#a2214277313b65e0e19f63c5ccddc350e">key_assoc</a> = map&lt;int, string&gt;();
<a name="l00018"></a>00018 }
<a name="l00019"></a>00019 
<a name="l00031"></a><a class="code" href="classSetArguments.html#a26fe5a8bfa786907cfef31c3fadba5d0">00031</a> <a class="code" href="classSetArguments.html#acbba23977f0c9fc09a827b0b1c9df7a3" title="Simple constructor.">SetArguments::SetArguments</a>(<a class="code" href="classAF.html" title="Class encompassing an Argumentation Framework.">AF</a> af, <span class="keywordtype">string</span> names[], <span class="keywordtype">int</span> length){
<a name="l00032"></a>00032         this-&gt;<a class="code" href="classSetArguments.html#aaae0e0a7aeffe21d3ec1e0254f4bf364">arguments</a> = map&lt;string, Argument *&gt;();
<a name="l00033"></a>00033         this-&gt;<a class="code" href="classSetArguments.html#a2214277313b65e0e19f63c5ccddc350e">key_assoc</a> = map&lt;int, string&gt;();
<a name="l00034"></a>00034         <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i=0; i&lt;length; i++)
<a name="l00035"></a>00035                 this-&gt;<a class="code" href="classSetArguments.html#a989d8986ecf49baa0dc982766c0a5df4" title="Add an argument to the set.">add_Argument</a>(af.<a class="code" href="classAF.html#ab2eccb345f0ebfc6fc2b5cb9f456651b" title="This method returns the pointer to the Argument whose name is given as parameter.">getArgumentByName</a>(names[i]));
<a name="l00036"></a>00036 }
<a name="l00037"></a>00037 
<a name="l00056"></a><a class="code" href="classSetArguments.html#a989d8986ecf49baa0dc982766c0a5df4">00056</a> <span class="keywordtype">void</span> <a class="code" href="classSetArguments.html#a989d8986ecf49baa0dc982766c0a5df4" title="Add an argument to the set.">SetArguments::add_Argument</a>(<a class="code" href="classArgument.html" title="Class representing an Argument.">Argument</a> *arg)
<a name="l00057"></a>00057 {
<a name="l00058"></a>00058         this-&gt;<a class="code" href="classSetArguments.html#aaae0e0a7aeffe21d3ec1e0254f4bf364">arguments</a>.insert(pair&lt;string, Argument *&gt;(arg-&gt;<a class="code" href="classArgument.html#a95323c2bfcbb4c0d494acc13f76cc28a" title="Method returning the name of the argument.">getName</a>(), arg));
<a name="l00059"></a>00059         this-&gt;<a class="code" href="classSetArguments.html#a2214277313b65e0e19f63c5ccddc350e">key_assoc</a>.insert(pair&lt;int, string&gt;(arg-&gt;<a class="code" href="classArgument.html#aa26daf8c55afbe7d0970b23fbdbc96ca" title="Method returning the unique integer identifier of this argument.">getNumber</a>(), arg-&gt;<a class="code" href="classArgument.html#a95323c2bfcbb4c0d494acc13f76cc28a" title="Method returning the name of the argument.">getName</a>()));
<a name="l00060"></a>00060 }
<a name="l00061"></a>00061 
<a name="l00066"></a><a class="code" href="classSetArguments.html#a66d5b1cc6b684700c2394a8cf62ef7f0">00066</a> <span class="keywordtype">int</span> <a class="code" href="classSetArguments.html#a66d5b1cc6b684700c2394a8cf62ef7f0" title="Retuns the cardinality of this set.">SetArguments::cardinality</a>()<span class="keyword"> const </span>{
<a name="l00067"></a>00067         <span class="keywordflow">return</span> (<span class="keywordtype">int</span>) this-&gt;<a class="code" href="classSetArguments.html#aaae0e0a7aeffe21d3ec1e0254f4bf364">arguments</a>.size();
<a name="l00068"></a>00068 }
<a name="l00069"></a>00069 
<a name="l00075"></a><a class="code" href="classSetArguments.html#ab4ddcd0942b0fa06de4ab9726e12edef">00075</a> <a class="code" href="classArgument.html" title="Class representing an Argument.">Argument</a> *<a class="code" href="classSetArguments.html#ab4ddcd0942b0fa06de4ab9726e12edef" title="This method returns the pointer to the Argument whose name is given as parameter.">SetArguments::getArgumentByName</a>(<span class="keywordtype">string</span> name) {
<a name="l00076"></a>00076 
<a name="l00077"></a>00077         <span class="keywordflow">return</span> this-&gt;<a class="code" href="classSetArguments.html#aaae0e0a7aeffe21d3ec1e0254f4bf364">arguments</a>.at(name);
<a name="l00078"></a>00078 }
<a name="l00079"></a>00079 
<a name="l00085"></a><a class="code" href="classSetArguments.html#a119cb47c6e77b8faf10135d90c5b68b9">00085</a> <a class="code" href="classArgument.html" title="Class representing an Argument.">Argument</a> *<a class="code" href="classSetArguments.html#a119cb47c6e77b8faf10135d90c5b68b9" title="This method returns the pointer to the Argument whose identification number is given as parameter...">SetArguments::getArgumentByNumber</a>(<span class="keywordtype">int</span> num) {
<a name="l00086"></a>00086 
<a name="l00087"></a>00087         <span class="keywordflow">return</span> this-&gt;<a class="code" href="classSetArguments.html#aaae0e0a7aeffe21d3ec1e0254f4bf364">arguments</a>.at(this-&gt;<a class="code" href="classSetArguments.html#a2214277313b65e0e19f63c5ccddc350e">key_assoc</a>.at(num));
<a name="l00088"></a>00088 }
<a name="l00089"></a>00089 
<a name="l00094"></a><a class="code" href="classSetArguments.html#a91e548daa6d0859946c8604b1ebb8c5a">00094</a> <span class="keywordtype">bool</span> <a class="code" href="classSetArguments.html#a91e548daa6d0859946c8604b1ebb8c5a" title="Check wether or not this set is empty.">SetArguments::empty</a>() {
<a name="l00095"></a>00095 
<a name="l00096"></a>00096         <span class="keywordflow">return</span> this-&gt;<a class="code" href="classSetArguments.html#aaae0e0a7aeffe21d3ec1e0254f4bf364">arguments</a>.empty();
<a name="l00097"></a>00097 }
<a name="l00098"></a>00098 
<a name="l00103"></a><a class="code" href="classSetArguments.html#aaee058feaed861edf27739fa04f374ef">00103</a> <a class="code" href="classSetArgumentsIterator.html" title="Class defining a const iterator for the elements of a set of arguments.">SetArgumentsIterator</a> <a class="code" href="classSetArguments.html#aaee058feaed861edf27739fa04f374ef" title="Begin of the iterator for this set of arguments.">SetArguments::begin</a>()<span class="keyword"> const </span>{
<a name="l00104"></a>00104 
<a name="l00105"></a>00105         <span class="keywordflow">return</span> <a class="code" href="classSetArgumentsIterator.html" title="Class defining a const iterator for the elements of a set of arguments.">SetArgumentsIterator</a>((this-&gt;<a class="code" href="classSetArguments.html#aaae0e0a7aeffe21d3ec1e0254f4bf364">arguments</a>.begin()));
<a name="l00106"></a>00106 }
<a name="l00107"></a>00107 
<a name="l00112"></a><a class="code" href="classSetArguments.html#a551272d71c803f64efc155b04f41e775">00112</a> <a class="code" href="classSetArgumentsIterator.html" title="Class defining a const iterator for the elements of a set of arguments.">SetArgumentsIterator</a> <a class="code" href="classSetArguments.html#a551272d71c803f64efc155b04f41e775" title="End of the iterator for this set of arguments.">SetArguments::end</a>()<span class="keyword"> const </span>{
<a name="l00113"></a>00113 
<a name="l00114"></a>00114         <span class="keywordflow">return</span> <a class="code" href="classSetArgumentsIterator.html" title="Class defining a const iterator for the elements of a set of arguments.">SetArgumentsIterator</a>(this-&gt;<a class="code" href="classSetArguments.html#aaae0e0a7aeffe21d3ec1e0254f4bf364">arguments</a>.end());
<a name="l00115"></a>00115 }
<a name="l00116"></a>00116 
<a name="l00122"></a><a class="code" href="classSetArguments.html#a097087545407fc1eac981e31786e8168">00122</a> <span class="keywordtype">bool</span> <a class="code" href="classSetArguments.html#a097087545407fc1eac981e31786e8168" title="Check whether this set is a subset of `other`.">SetArguments::is_subset_equal</a>(<a class="code" href="classSetArguments.html" title="Class encompassing a set of arguments.">SetArguments</a> *other) {
<a name="l00123"></a>00123 
<a name="l00124"></a>00124         <span class="keywordflow">if</span> (this-&gt;<a class="code" href="classSetArguments.html#a91e548daa6d0859946c8604b1ebb8c5a" title="Check wether or not this set is empty.">empty</a>() &amp;&amp; other-&gt;<a class="code" href="classSetArguments.html#a91e548daa6d0859946c8604b1ebb8c5a" title="Check wether or not this set is empty.">empty</a>())
<a name="l00125"></a>00125                 <span class="keywordflow">return</span> <span class="keyword">true</span>;
<a name="l00126"></a>00126         <span class="keywordflow">if</span> (this-&gt;<a class="code" href="classSetArguments.html#a91e548daa6d0859946c8604b1ebb8c5a" title="Check wether or not this set is empty.">empty</a>() &amp;&amp; !other-&gt;<a class="code" href="classSetArguments.html#a91e548daa6d0859946c8604b1ebb8c5a" title="Check wether or not this set is empty.">empty</a>())
<a name="l00127"></a>00127                 <span class="keywordflow">return</span> <span class="keyword">true</span>;
<a name="l00128"></a>00128         <span class="keywordflow">if</span> (!this-&gt;<a class="code" href="classSetArguments.html#a91e548daa6d0859946c8604b1ebb8c5a" title="Check wether or not this set is empty.">empty</a>() &amp;&amp; other-&gt;<a class="code" href="classSetArguments.html#a91e548daa6d0859946c8604b1ebb8c5a" title="Check wether or not this set is empty.">empty</a>())
<a name="l00129"></a>00129                 <span class="keywordflow">return</span> <span class="keyword">false</span>;
<a name="l00130"></a>00130         <span class="keywordflow">if</span> (this-&gt;<a class="code" href="classSetArguments.html#a66d5b1cc6b684700c2394a8cf62ef7f0" title="Retuns the cardinality of this set.">cardinality</a>() &gt; other-&gt;<a class="code" href="classSetArguments.html#a66d5b1cc6b684700c2394a8cf62ef7f0" title="Retuns the cardinality of this set.">cardinality</a>())
<a name="l00131"></a>00131                 <span class="keywordflow">return</span> <span class="keyword">false</span>;
<a name="l00132"></a>00132         <span class="keywordflow">for</span> (<a class="code" href="classSetArgumentsIterator.html" title="Class defining a const iterator for the elements of a set of arguments.">SetArgumentsIterator</a> it = this-&gt;<a class="code" href="classSetArguments.html#aaee058feaed861edf27739fa04f374ef" title="Begin of the iterator for this set of arguments.">begin</a>(); it != this-&gt;<a class="code" href="classSetArguments.html#a551272d71c803f64efc155b04f41e775" title="End of the iterator for this set of arguments.">end</a>(); it++)
<a name="l00133"></a>00133                 <span class="keywordflow">if</span> (!other-&gt;<a class="code" href="classSetArguments.html#a0be6b8f77319a6aec9127eccd3ee43d9" title="Check whether or not an argument exists in this set.">exists</a>((*it)))
<a name="l00134"></a>00134                         <span class="keywordflow">return</span> <span class="keyword">false</span>;
<a name="l00135"></a>00135         <span class="keywordflow">return</span> <span class="keyword">true</span>;
<a name="l00136"></a>00136 }
<a name="l00137"></a>00137 
<a name="l00143"></a><a class="code" href="classSetArguments.html#a3d0a8527f2fa9ad3a888eb387c980a78">00143</a> <span class="keywordtype">bool</span> <a class="code" href="classSetArguments.html#a3d0a8527f2fa9ad3a888eb387c980a78" title="Check whether this set is a proper subset of `other`.">SetArguments::is_subset</a>(<a class="code" href="classSetArguments.html" title="Class encompassing a set of arguments.">SetArguments</a> *other) {
<a name="l00144"></a>00144 
<a name="l00145"></a>00145         <span class="keywordflow">if</span> ((this-&gt;<a class="code" href="classSetArguments.html#a66d5b1cc6b684700c2394a8cf62ef7f0" title="Retuns the cardinality of this set.">cardinality</a>() &lt; other-&gt;<a class="code" href="classSetArguments.html#a66d5b1cc6b684700c2394a8cf62ef7f0" title="Retuns the cardinality of this set.">cardinality</a>()) &amp;&amp; this-&gt;<a class="code" href="classSetArguments.html#a097087545407fc1eac981e31786e8168" title="Check whether this set is a subset of `other`.">is_subset_equal</a>(other))
<a name="l00146"></a>00146                 <span class="keywordflow">return</span> <span class="keyword">true</span>;
<a name="l00147"></a>00147         <span class="keywordflow">return</span> <span class="keyword">false</span>;
<a name="l00148"></a>00148 }
<a name="l00149"></a>00149 
<a name="l00197"></a><a class="code" href="classSetArguments.html#a83fb1143e82cef2d73fe859cda33f35c">00197</a> vector&lt;SetArguments*&gt; <a class="code" href="classSetArguments.html#a83fb1143e82cef2d73fe859cda33f35c" title="convert a SetArguments in a vector of SetArguments">SetArguments::getSingletons</a>() {
<a name="l00198"></a>00198         vector&lt;SetArguments*&gt; singletons = vector&lt;SetArguments*&gt;();
<a name="l00199"></a>00199         <span class="keywordflow">for</span> (<a class="code" href="classSetArgumentsIterator.html" title="Class defining a const iterator for the elements of a set of arguments.">SetArgumentsIterator</a> it = this-&gt;<a class="code" href="classSetArguments.html#aaee058feaed861edf27739fa04f374ef" title="Begin of the iterator for this set of arguments.">begin</a>(); it!= this-&gt;<a class="code" href="classSetArguments.html#a551272d71c803f64efc155b04f41e775" title="End of the iterator for this set of arguments.">end</a>(); it++) {
<a name="l00200"></a>00200                 <a class="code" href="classSetArguments.html" title="Class encompassing a set of arguments.">SetArguments</a> *s = <span class="keyword">new</span> <a class="code" href="classSetArguments.html#acbba23977f0c9fc09a827b0b1c9df7a3" title="Simple constructor.">SetArguments</a>();
<a name="l00201"></a>00201                 s-&gt;<a class="code" href="classSetArguments.html#a989d8986ecf49baa0dc982766c0a5df4" title="Add an argument to the set.">add_Argument</a>(*it);
<a name="l00202"></a>00202                 singletons.push_back(s);
<a name="l00203"></a>00203         }
<a name="l00204"></a>00204         <span class="keywordflow">return</span> singletons;
<a name="l00205"></a>00205 }
<a name="l00206"></a>00206 
<a name="l00242"></a><a class="code" href="classSetArguments.html#a288d7f85ace570bba59f76d096d8131f">00242</a> <a class="code" href="classSetArguments.html" title="Class encompassing a set of arguments.">SetArguments</a>* <a class="code" href="classSetArguments.html#a288d7f85ace570bba59f76d096d8131f">SetArguments::getArgumentAttacksInSet</a>(<a class="code" href="classArgument.html" title="Class representing an Argument.">Argument</a>* arg){
<a name="l00243"></a>00243         <a class="code" href="classSetArguments.html" title="Class encompassing a set of arguments.">SetArguments</a>* resulttmp;
<a name="l00244"></a>00244         resulttmp=arg-&gt;<a class="code" href="classArgument.html#ae8c77c2d0676845f250d77dfb3ce4378" title="Method returning the set of attackers.">get_attacks</a>();
<a name="l00245"></a>00245         <span class="comment">//devo togliere da resulttmp tutti i nodi che non appartengono a setarg</span>
<a name="l00246"></a>00246         resulttmp-&gt;<a class="code" href="classSetArguments.html#a5e8996e87ad044c231611f0075fb600b">synchWithSet</a>(<span class="keyword">this</span>);
<a name="l00247"></a>00247         <span class="keywordflow">return</span> resulttmp;
<a name="l00248"></a>00248 }
<a name="l00249"></a>00249 
<a name="l00285"></a><a class="code" href="classSetArguments.html#aa74c9b4aeec56b029eed6e9f4435b0cb">00285</a> <a class="code" href="classSetArguments.html" title="Class encompassing a set of arguments.">SetArguments</a>* <a class="code" href="classSetArguments.html#aa74c9b4aeec56b029eed6e9f4435b0cb">SetArguments::getArgumentAttackersInSet</a>(<a class="code" href="classArgument.html" title="Class representing an Argument.">Argument</a>* arg){
<a name="l00286"></a>00286         <a class="code" href="classSetArguments.html" title="Class encompassing a set of arguments.">SetArguments</a>* resulttmp;
<a name="l00287"></a>00287         resulttmp=arg-&gt;<a class="code" href="classArgument.html#aa57914a9e5a27af3c3dbd1db8c0d3602" title="Method returning the set of attacked arguments.">get_attackers</a>();
<a name="l00288"></a>00288         <span class="comment">//devo togliere da resulttmp tutti i nodi che non appartengono a setarg</span>
<a name="l00289"></a>00289         resulttmp-&gt;<a class="code" href="classSetArguments.html#a5e8996e87ad044c231611f0075fb600b">synchWithSet</a>(<span class="keyword">this</span>);
<a name="l00290"></a>00290         <span class="keywordflow">return</span> resulttmp;
<a name="l00291"></a>00291 }
<a name="l00292"></a>00292 
<a name="l00306"></a><a class="code" href="classSetArguments.html#a80e626de391cabfc0a20da509c328055">00306</a> <span class="keywordtype">void</span> <a class="code" href="classSetArguments.html#a80e626de391cabfc0a20da509c328055" title="Setmisun.">SetArguments::setminus</a>(<a class="code" href="classSetArguments.html" title="Class encompassing a set of arguments.">SetArguments</a> *other, <a class="code" href="classSetArguments.html" title="Class encompassing a set of arguments.">SetArguments</a> *result) {
<a name="l00307"></a>00307 
<a name="l00308"></a>00308         this-&gt;<a class="code" href="classSetArguments.html#a3a3052b05dff877886f84ab99280d6f7" title="Clone this set.">clone</a>(result);
<a name="l00309"></a>00309         <span class="keywordflow">for</span> (<a class="code" href="classSetArgumentsIterator.html" title="Class defining a const iterator for the elements of a set of arguments.">SetArgumentsIterator</a> it = other-&gt;<a class="code" href="classSetArguments.html#aaee058feaed861edf27739fa04f374ef" title="Begin of the iterator for this set of arguments.">begin</a>(); it != other-&gt;<a class="code" href="classSetArguments.html#a551272d71c803f64efc155b04f41e775" title="End of the iterator for this set of arguments.">end</a>(); it++)
<a name="l00310"></a>00310                 <span class="keywordflow">if</span> (result-&gt;<a class="code" href="classSetArguments.html#a0be6b8f77319a6aec9127eccd3ee43d9" title="Check whether or not an argument exists in this set.">exists</a>((*it)))
<a name="l00311"></a>00311                         result-&gt;<a class="code" href="classSetArguments.html#a11b8009ff9cd0961731eac8ee95c4b55" title="Remove an argument from this set.">remove</a>((*it));
<a name="l00312"></a>00312 }
<a name="l00313"></a>00313 
<a name="l00319"></a><a class="code" href="classSetArguments.html#a0be6b8f77319a6aec9127eccd3ee43d9">00319</a> <span class="keywordtype">bool</span> <a class="code" href="classSetArguments.html#a0be6b8f77319a6aec9127eccd3ee43d9" title="Check whether or not an argument exists in this set.">SetArguments::exists</a>(<a class="code" href="classArgument.html" title="Class representing an Argument.">Argument</a> * arg) {
<a name="l00320"></a>00320         <span class="keywordflow">return</span> (this-&gt;<a class="code" href="classSetArguments.html#aaae0e0a7aeffe21d3ec1e0254f4bf364">arguments</a>.find(arg-&gt;<a class="code" href="classArgument.html#a95323c2bfcbb4c0d494acc13f76cc28a" title="Method returning the name of the argument.">getName</a>()) != this-&gt;<a class="code" href="classSetArguments.html#aaae0e0a7aeffe21d3ec1e0254f4bf364">arguments</a>.end());
<a name="l00321"></a>00321 }
<a name="l00322"></a>00322 
<a name="l00338"></a><a class="code" href="classSetArguments.html#a11b8009ff9cd0961731eac8ee95c4b55">00338</a> <span class="keywordtype">void</span> <a class="code" href="classSetArguments.html#a11b8009ff9cd0961731eac8ee95c4b55" title="Remove an argument from this set.">SetArguments::remove</a>(<a class="code" href="classArgument.html" title="Class representing an Argument.">Argument</a> * arg) {
<a name="l00339"></a>00339 
<a name="l00340"></a>00340         this-&gt;<a class="code" href="classSetArguments.html#aaae0e0a7aeffe21d3ec1e0254f4bf364">arguments</a>.erase(arg-&gt;<a class="code" href="classArgument.html#a95323c2bfcbb4c0d494acc13f76cc28a" title="Method returning the name of the argument.">getName</a>());
<a name="l00341"></a>00341         <span class="comment">//TODO secondo me qui bisogna eliminare anche la referenza in keyassoc!!! Parlarne con Pat</span>
<a name="l00342"></a>00342         <span class="comment">//Pat: non è un metodo che abbiamo scritto noi, quindi vattelapesca</span>
<a name="l00343"></a>00343 }
<a name="l00344"></a>00344 
<a name="l00348"></a><a class="code" href="classSetArguments.html#a09a6ac57967a3eb26006fd1c61e8cf4a">00348</a> <span class="keywordtype">void</span> <a class="code" href="classSetArguments.html#a09a6ac57967a3eb26006fd1c61e8cf4a">SetArguments::remove_All_Arguments</a>(){
<a name="l00349"></a>00349         this-&gt;<a class="code" href="classSetArguments.html#aaae0e0a7aeffe21d3ec1e0254f4bf364">arguments</a>.clear();
<a name="l00350"></a>00350         this-&gt;<a class="code" href="classSetArguments.html#a2214277313b65e0e19f63c5ccddc350e">key_assoc</a>.clear();
<a name="l00351"></a>00351 }
<a name="l00352"></a>00352 
<a name="l00362"></a><a class="code" href="classSetArguments.html#a3a3052b05dff877886f84ab99280d6f7">00362</a> <span class="keywordtype">void</span> <a class="code" href="classSetArguments.html#a3a3052b05dff877886f84ab99280d6f7" title="Clone this set.">SetArguments::clone</a>(<a class="code" href="classSetArguments.html" title="Class encompassing a set of arguments.">SetArguments</a> * <span class="keyword">set</span>) {
<a name="l00363"></a>00363 
<a name="l00364"></a>00364         <span class="keywordflow">for</span> (<a class="code" href="classSetArgumentsIterator.html" title="Class defining a const iterator for the elements of a set of arguments.">SetArgumentsIterator</a> it = this-&gt;<a class="code" href="classSetArguments.html#aaee058feaed861edf27739fa04f374ef" title="Begin of the iterator for this set of arguments.">begin</a>(); it != this-&gt;<a class="code" href="classSetArguments.html#a551272d71c803f64efc155b04f41e775" title="End of the iterator for this set of arguments.">end</a>(); it++)
<a name="l00365"></a>00365                 set-&gt;add_Argument((*it));
<a name="l00366"></a>00366 }
<a name="l00367"></a>00367 
<a name="l00415"></a><a class="code" href="classSetArguments.html#a8f48fd9f7b627db762d4fc2621160853">00415</a> <a class="code" href="classSetArguments.html" title="Class encompassing a set of arguments.">SetArguments</a>* <a class="code" href="classSetArguments.html#a8f48fd9f7b627db762d4fc2621160853" title="Get the arguments in the caller set which are attacked by at least one node in attackers.">SetArguments::getSubsetAttackedBy</a>(<a class="code" href="classSetArguments.html" title="Class encompassing a set of arguments.">SetArguments</a>* attackersSet){
<a name="l00416"></a>00416 
<a name="l00417"></a>00417         <a class="code" href="classSetArguments.html" title="Class encompassing a set of arguments.">SetArguments</a>* nodeset;
<a name="l00418"></a>00418         <a class="code" href="classSetArguments.html" title="Class encompassing a set of arguments.">SetArguments</a>* result = <span class="keyword">new</span> <a class="code" href="classSetArguments.html#acbba23977f0c9fc09a827b0b1c9df7a3" title="Simple constructor.">SetArguments</a>();
<a name="l00419"></a>00419 
<a name="l00420"></a>00420         <span class="keywordflow">for</span> (<span class="keyword">auto</span> it=this-&gt;<a class="code" href="classSetArguments.html#aaee058feaed861edf27739fa04f374ef" title="Begin of the iterator for this set of arguments.">begin</a>(); it!=this-&gt;<a class="code" href="classSetArguments.html#a551272d71c803f64efc155b04f41e775" title="End of the iterator for this set of arguments.">end</a>(); it++){
<a name="l00421"></a>00421                 nodeset=(*it)-&gt;get_attackers();
<a name="l00422"></a>00422                 <span class="keywordflow">for</span> (<span class="keyword">auto</span> it2=nodeset-&gt;<a class="code" href="classSetArguments.html#aaee058feaed861edf27739fa04f374ef" title="Begin of the iterator for this set of arguments.">begin</a>(); it2!=nodeset-&gt;<a class="code" href="classSetArguments.html#a551272d71c803f64efc155b04f41e775" title="End of the iterator for this set of arguments.">end</a>(); it2++)
<a name="l00423"></a>00423                         <span class="keywordflow">if</span> (attackersSet-&gt;<a class="code" href="classSetArguments.html#a0be6b8f77319a6aec9127eccd3ee43d9" title="Check whether or not an argument exists in this set.">exists</a>(*it2)==<span class="keyword">true</span>)
<a name="l00424"></a>00424                                 result-&gt;<a class="code" href="classSetArguments.html#a989d8986ecf49baa0dc982766c0a5df4" title="Add an argument to the set.">add_Argument</a>(*it);
<a name="l00425"></a>00425         }
<a name="l00426"></a>00426         <span class="keywordflow">return</span> result;
<a name="l00427"></a>00427 }
<a name="l00428"></a>00428 
<a name="l00478"></a><a class="code" href="classSetArguments.html#a0b7a69e50ba0141effc24c77f72195f8">00478</a> <a class="code" href="classSetArguments.html" title="Class encompassing a set of arguments.">SetArguments</a>* <a class="code" href="classSetArguments.html#a0b7a69e50ba0141effc24c77f72195f8" title="Retrieve the arguments in the caller set which attacks at least one node in the attacked set...">SetArguments::getSubsetAttacks</a>(<a class="code" href="classSetArguments.html" title="Class encompassing a set of arguments.">SetArguments</a>* attacked){
<a name="l00479"></a>00479 
<a name="l00480"></a>00480         <a class="code" href="classSetArguments.html" title="Class encompassing a set of arguments.">SetArguments</a>* nodeset;
<a name="l00481"></a>00481         <a class="code" href="classSetArguments.html" title="Class encompassing a set of arguments.">SetArguments</a>* result = <span class="keyword">new</span> <a class="code" href="classSetArguments.html#acbba23977f0c9fc09a827b0b1c9df7a3" title="Simple constructor.">SetArguments</a>();
<a name="l00482"></a>00482 
<a name="l00483"></a>00483         <span class="keywordflow">for</span> (<span class="keyword">auto</span> it=this-&gt;<a class="code" href="classSetArguments.html#aaee058feaed861edf27739fa04f374ef" title="Begin of the iterator for this set of arguments.">begin</a>(); it!=this-&gt;<a class="code" href="classSetArguments.html#a551272d71c803f64efc155b04f41e775" title="End of the iterator for this set of arguments.">end</a>(); it++){
<a name="l00484"></a>00484                 nodeset=(*it)-&gt;get_attacks();
<a name="l00485"></a>00485                 <span class="keywordflow">for</span> (<span class="keyword">auto</span> it2=nodeset-&gt;<a class="code" href="classSetArguments.html#aaee058feaed861edf27739fa04f374ef" title="Begin of the iterator for this set of arguments.">begin</a>(); it2!=nodeset-&gt;<a class="code" href="classSetArguments.html#a551272d71c803f64efc155b04f41e775" title="End of the iterator for this set of arguments.">end</a>(); it2++)
<a name="l00486"></a>00486                         <span class="keywordflow">if</span> (attacked-&gt;<a class="code" href="classSetArguments.html#a0be6b8f77319a6aec9127eccd3ee43d9" title="Check whether or not an argument exists in this set.">exists</a>(*it2)==<span class="keyword">true</span>)
<a name="l00487"></a>00487                                 result-&gt;<a class="code" href="classSetArguments.html#a989d8986ecf49baa0dc982766c0a5df4" title="Add an argument to the set.">add_Argument</a>(*it);
<a name="l00488"></a>00488         }
<a name="l00489"></a>00489         <span class="keywordflow">return</span> result;
<a name="l00490"></a>00490 }
<a name="l00491"></a>00491 
<a name="l00553"></a><a class="code" href="classSetArguments.html#a58ec72f524211aaf319f6d50a2ab18ce">00553</a> <span class="keywordtype">void</span> <a class="code" href="classSetArguments.html#a58ec72f524211aaf319f6d50a2ab18ce" title="return all nodes contained in the caller set and contained in other.">SetArguments::setSafeRestrict</a>(<a class="code" href="classSetArguments.html" title="Class encompassing a set of arguments.">SetArguments</a>* other, <a class="code" href="classSetArguments.html" title="Class encompassing a set of arguments.">SetArguments</a>* result){
<a name="l00554"></a>00554         other-&gt;<a class="code" href="classSetArguments.html#a3a3052b05dff877886f84ab99280d6f7" title="Clone this set.">clone</a>(result);
<a name="l00555"></a>00555 }
<a name="l00556"></a>00556 
<a name="l00582"></a><a class="code" href="classSetArguments.html#a5e8996e87ad044c231611f0075fb600b">00582</a> <span class="keywordtype">void</span> <a class="code" href="classSetArguments.html#a5e8996e87ad044c231611f0075fb600b">SetArguments::synchWithSet</a>(<a class="code" href="classSetArguments.html" title="Class encompassing a set of arguments.">SetArguments</a>* otherset){
<a name="l00583"></a>00583         <span class="keywordflow">for</span> (<span class="keyword">auto</span> it=this-&gt;<a class="code" href="classSetArguments.html#aaee058feaed861edf27739fa04f374ef" title="Begin of the iterator for this set of arguments.">begin</a>(); it!=this-&gt;<a class="code" href="classSetArguments.html#a551272d71c803f64efc155b04f41e775" title="End of the iterator for this set of arguments.">end</a>();it++)
<a name="l00584"></a>00584                 <span class="keywordflow">if</span> (otherset-&gt;<a class="code" href="classSetArguments.html#a0be6b8f77319a6aec9127eccd3ee43d9" title="Check whether or not an argument exists in this set.">exists</a>(*it)==<span class="keyword">false</span>)
<a name="l00585"></a>00585                         this-&gt;<span class="keyword">remove</span>(*it);
<a name="l00586"></a>00586 }
<a name="l00587"></a>00587 
<a name="l00628"></a><a class="code" href="classSetArguments.html#ae056e1f79c10adb6c9a67215ab26edb9">00628</a> <a class="code" href="classSetArguments.html" title="Class encompassing a set of arguments.">SetArguments</a>* <a class="code" href="classSetArguments.html#ae056e1f79c10adb6c9a67215ab26edb9">SetArguments::getAllAttackers</a>() {
<a name="l00629"></a>00629 
<a name="l00630"></a>00630         <a class="code" href="classSetArguments.html" title="Class encompassing a set of arguments.">SetArguments</a>* result=<span class="keyword">new</span> <a class="code" href="classSetArguments.html#acbba23977f0c9fc09a827b0b1c9df7a3" title="Simple constructor.">SetArguments</a>();
<a name="l00631"></a>00631 
<a name="l00632"></a>00632         <span class="keywordflow">for</span> (<a class="code" href="classSetArgumentsIterator.html" title="Class defining a const iterator for the elements of a set of arguments.">SetArgumentsIterator</a> it=this-&gt;<a class="code" href="classSetArguments.html#aaee058feaed861edf27739fa04f374ef" title="Begin of the iterator for this set of arguments.">begin</a>(); it!= this-&gt;<a class="code" href="classSetArguments.html#a551272d71c803f64efc155b04f41e775" title="End of the iterator for this set of arguments.">end</a>(); it++) {
<a name="l00633"></a>00633                 <a class="code" href="classSetArguments.html" title="Class encompassing a set of arguments.">SetArguments</a>* nodeAttackers = (*it)-&gt;get_attackers();
<a name="l00634"></a>00634                 <span class="keywordflow">for</span> (<a class="code" href="classSetArgumentsIterator.html" title="Class defining a const iterator for the elements of a set of arguments.">SetArgumentsIterator</a> it2=nodeAttackers-&gt;<a class="code" href="classSetArguments.html#aaee058feaed861edf27739fa04f374ef" title="Begin of the iterator for this set of arguments.">begin</a>(); it2!=nodeAttackers-&gt;<a class="code" href="classSetArguments.html#a551272d71c803f64efc155b04f41e775" title="End of the iterator for this set of arguments.">end</a>(); it2++)
<a name="l00635"></a>00635                         result-&gt;<a class="code" href="classSetArguments.html#a989d8986ecf49baa0dc982766c0a5df4" title="Add an argument to the set.">add_Argument</a>(*it2);
<a name="l00636"></a>00636         }
<a name="l00637"></a>00637         <span class="keywordflow">return</span> result;
<a name="l00638"></a>00638 }
<a name="l00639"></a>00639 
<a name="l00680"></a><a class="code" href="classSetArguments.html#ab7c0f1063978299f753e91e11f0818ef">00680</a> <a class="code" href="classSetArguments.html" title="Class encompassing a set of arguments.">SetArguments</a>* <a class="code" href="classSetArguments.html#ab7c0f1063978299f753e91e11f0818ef">SetArguments::getAllAttacks</a>() {
<a name="l00681"></a>00681 
<a name="l00682"></a>00682         <a class="code" href="classSetArguments.html" title="Class encompassing a set of arguments.">SetArguments</a>* result=<span class="keyword">new</span> <a class="code" href="classSetArguments.html#acbba23977f0c9fc09a827b0b1c9df7a3" title="Simple constructor.">SetArguments</a>();
<a name="l00683"></a>00683 
<a name="l00684"></a>00684         <span class="keywordflow">for</span> (<a class="code" href="classSetArgumentsIterator.html" title="Class defining a const iterator for the elements of a set of arguments.">SetArgumentsIterator</a> it=this-&gt;<a class="code" href="classSetArguments.html#aaee058feaed861edf27739fa04f374ef" title="Begin of the iterator for this set of arguments.">begin</a>(); it!= this-&gt;<a class="code" href="classSetArguments.html#a551272d71c803f64efc155b04f41e775" title="End of the iterator for this set of arguments.">end</a>(); it++) {
<a name="l00685"></a>00685                 <a class="code" href="classSetArguments.html" title="Class encompassing a set of arguments.">SetArguments</a>* nodeAttacks = (*it)-&gt;get_attacks();
<a name="l00686"></a>00686                 <span class="keywordflow">for</span> (<a class="code" href="classSetArgumentsIterator.html" title="Class defining a const iterator for the elements of a set of arguments.">SetArgumentsIterator</a> it2=nodeAttacks-&gt;<a class="code" href="classSetArguments.html#aaee058feaed861edf27739fa04f374ef" title="Begin of the iterator for this set of arguments.">begin</a>(); it2!=nodeAttacks-&gt;<a class="code" href="classSetArguments.html#a551272d71c803f64efc155b04f41e775" title="End of the iterator for this set of arguments.">end</a>(); it2++)
<a name="l00687"></a>00687                         result-&gt;<a class="code" href="classSetArguments.html#a989d8986ecf49baa0dc982766c0a5df4" title="Add an argument to the set.">add_Argument</a>(*it2);
<a name="l00688"></a>00688         }
<a name="l00689"></a>00689         <span class="keywordflow">return</span> result;
<a name="l00690"></a>00690 }
<a name="l00691"></a>00691 
<a name="l00726"></a><a class="code" href="classSetArguments.html#a614c3bbe2f99592b1199007b008c1785">00726</a> <a class="code" href="classSetArguments.html" title="Class encompassing a set of arguments.">SetArguments</a>* <a class="code" href="classSetArguments.html#a614c3bbe2f99592b1199007b008c1785" title="computes all the nodes who are attacked by other node in this set">SetArguments::getAllAttackersInSet</a>(){
<a name="l00727"></a>00727         <a class="code" href="classSetArguments.html" title="Class encompassing a set of arguments.">SetArguments</a>* result=this-&gt;<a class="code" href="classSetArguments.html#ae056e1f79c10adb6c9a67215ab26edb9">getAllAttackers</a>();
<a name="l00728"></a>00728         result-&gt;<a class="code" href="classSetArguments.html#a5e8996e87ad044c231611f0075fb600b">synchWithSet</a>(<span class="keyword">this</span>);
<a name="l00729"></a>00729         <span class="keywordflow">return</span> result;
<a name="l00730"></a>00730 }
<a name="l00731"></a>00731 
<a name="l00766"></a><a class="code" href="classSetArguments.html#a74f991246010dfc03b5dcde3bf08370a">00766</a> <a class="code" href="classSetArguments.html" title="Class encompassing a set of arguments.">SetArguments</a>* <a class="code" href="classSetArguments.html#a74f991246010dfc03b5dcde3bf08370a" title="computes all the nodes which attacks other nodes in this very set">SetArguments::getAllAttacksInSet</a>(){
<a name="l00767"></a>00767         <a class="code" href="classSetArguments.html" title="Class encompassing a set of arguments.">SetArguments</a>* result=this-&gt;<a class="code" href="classSetArguments.html#ab7c0f1063978299f753e91e11f0818ef">getAllAttacks</a>();
<a name="l00768"></a>00768         result-&gt;<a class="code" href="classSetArguments.html#a5e8996e87ad044c231611f0075fb600b">synchWithSet</a>(<span class="keyword">this</span>);
<a name="l00769"></a>00769         <span class="keywordflow">return</span> result;
<a name="l00770"></a>00770 }
<a name="l00771"></a>00771 
<a name="l00773"></a><a class="code" href="classSetArguments.html#a49b6431d7a3324073dc01ae8d6648372">00773</a> <a class="code" href="classSetArguments.html" title="Class encompassing a set of arguments.">SetArguments</a>* <a class="code" href="classSetArguments.html#a49b6431d7a3324073dc01ae8d6648372">SetArguments::getExternalAttackers</a>() {
<a name="l00774"></a>00774 
<a name="l00775"></a>00775         <a class="code" href="classSetArguments.html" title="Class encompassing a set of arguments.">SetArguments</a>* result = <span class="keyword">new</span> <a class="code" href="classSetArguments.html#acbba23977f0c9fc09a827b0b1c9df7a3" title="Simple constructor.">SetArguments</a>();
<a name="l00776"></a>00776         <a class="code" href="classSetArguments.html" title="Class encompassing a set of arguments.">SetArguments</a>* allAttackers = <span class="keyword">new</span> <a class="code" href="classSetArguments.html#acbba23977f0c9fc09a827b0b1c9df7a3" title="Simple constructor.">SetArguments</a>();
<a name="l00777"></a>00777         allAttackers=this-&gt;<a class="code" href="classSetArguments.html#ae056e1f79c10adb6c9a67215ab26edb9">getAllAttackers</a>();
<a name="l00778"></a>00778         this-&gt;<a class="code" href="classSetArguments.html#a80e626de391cabfc0a20da509c328055" title="Setmisun.">setminus</a>(allAttackers, result);
<a name="l00779"></a>00779         <span class="keyword">delete</span> allAttackers;
<a name="l00780"></a>00780         <span class="keywordflow">return</span> result;
<a name="l00781"></a>00781 }
<a name="l00782"></a>00782 
<a name="l00784"></a><a class="code" href="classSetArguments.html#a5a24f9102351dae14b00f3cd4a4c272c">00784</a> <a class="code" href="classSetArguments.html" title="Class encompassing a set of arguments.">SetArguments</a>* <a class="code" href="classSetArguments.html#a5a24f9102351dae14b00f3cd4a4c272c">SetArguments::getExternalAttacks</a>() {
<a name="l00785"></a>00785 
<a name="l00786"></a>00786         <a class="code" href="classSetArguments.html" title="Class encompassing a set of arguments.">SetArguments</a>* result = <span class="keyword">new</span> <a class="code" href="classSetArguments.html#acbba23977f0c9fc09a827b0b1c9df7a3" title="Simple constructor.">SetArguments</a>();
<a name="l00787"></a>00787         <a class="code" href="classSetArguments.html" title="Class encompassing a set of arguments.">SetArguments</a>* allAttacks = <span class="keyword">new</span> <a class="code" href="classSetArguments.html#acbba23977f0c9fc09a827b0b1c9df7a3" title="Simple constructor.">SetArguments</a>();
<a name="l00788"></a>00788         allAttacks=this-&gt;<a class="code" href="classSetArguments.html#ab7c0f1063978299f753e91e11f0818ef">getAllAttacks</a>();
<a name="l00789"></a>00789         this-&gt;<a class="code" href="classSetArguments.html#a80e626de391cabfc0a20da509c328055" title="Setmisun.">setminus</a>(allAttacks, result);
<a name="l00790"></a>00790         <span class="keyword">delete</span> allAttacks;
<a name="l00791"></a>00791         <span class="keywordflow">return</span> result;
<a name="l00792"></a>00792 }
<a name="l00793"></a>00793 
<a name="l00795"></a><a class="code" href="classSetArguments.html#a97ce4b4815433f7c573a5922eaec190d">00795</a> <span class="keywordtype">void</span> <a class="code" href="classSetArguments.html#a97ce4b4815433f7c573a5922eaec190d" title="per ogni nodo del grafo, stampa l&#39;insieme dei suoi nodi attaccanti e di quelli attaccati.">SetArguments::printNodeRelations</a>() {
<a name="l00796"></a>00796 
<a name="l00797"></a>00797         <span class="keywordflow">for</span> (<a class="code" href="classSetArgumentsIterator.html" title="Class defining a const iterator for the elements of a set of arguments.">SetArgumentsIterator</a> it = this-&gt;<a class="code" href="classSetArguments.html#aaee058feaed861edf27739fa04f374ef" title="Begin of the iterator for this set of arguments.">begin</a>(); it != this-&gt;<a class="code" href="classSetArguments.html#a551272d71c803f64efc155b04f41e775" title="End of the iterator for this set of arguments.">end</a>(); it++)
<a name="l00798"></a>00798                 cout &lt;&lt; <span class="stringliteral">&quot;\tNode:&quot;</span>&lt;&lt; (*it)-&gt;getName() &lt;&lt; <span class="stringliteral">&quot;(&quot;</span> &lt;&lt; (*it)-&gt;getNumber()
<a name="l00799"></a>00799                          &lt;&lt; <span class="stringliteral">&quot;) | attacks:&quot;</span>&lt;&lt; *(*it)-&gt;get_attacks()
<a name="l00800"></a>00800                          &lt;&lt; <span class="stringliteral">&quot; attackers:&quot;</span>&lt;&lt; *(*it)-&gt;get_attackers() &lt;&lt; endl;
<a name="l00801"></a>00801         cout &lt;&lt; <span class="stringliteral">&quot;\t~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~&quot;</span> &lt;&lt; endl;
<a name="l00802"></a>00802 }
<a name="l00803"></a>00803 
<a name="l00805"></a><a class="code" href="classSetArguments.html#a45abe3157dc0aceae68f130cc9613d08">00805</a> <span class="keywordtype">void</span> <a class="code" href="classSetArguments.html#a45abe3157dc0aceae68f130cc9613d08" title="stampa prima il set dei nodi del grafo, e poi richiama nodeRelations">SetArguments::printGraph</a>() {
<a name="l00806"></a>00806         cout &lt;&lt; <span class="stringliteral">&quot;~~~~ List of Nodes ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~&quot;</span> &lt;&lt; endl &lt;&lt; *<span class="keyword">this</span> &lt;&lt; endl;
<a name="l00807"></a>00807         <a class="code" href="classSetArguments.html#a97ce4b4815433f7c573a5922eaec190d" title="per ogni nodo del grafo, stampa l&#39;insieme dei suoi nodi attaccanti e di quelli attaccati.">printNodeRelations</a>();
<a name="l00808"></a>00808 }
<a name="l00809"></a>00809 
<a name="l00817"></a><a class="code" href="classSetArguments.html#a1b532abb70dde9aa99148be16ed59af1">00817</a> <span class="keywordtype">void</span> <a class="code" href="classSetArguments.html#a1b532abb70dde9aa99148be16ed59af1" title="Perform the union of two SetArguments.">SetArguments::merge</a>(<a class="code" href="classSetArguments.html" title="Class encompassing a set of arguments.">SetArguments</a>* other, <a class="code" href="classSetArguments.html" title="Class encompassing a set of arguments.">SetArguments</a>* result){
<a name="l00818"></a>00818         <span class="keywordflow">for</span> (<a class="code" href="classSetArgumentsIterator.html" title="Class defining a const iterator for the elements of a set of arguments.">SetArgumentsIterator</a> it= this-&gt;<a class="code" href="classSetArguments.html#aaee058feaed861edf27739fa04f374ef" title="Begin of the iterator for this set of arguments.">begin</a>(); it != this-&gt;<a class="code" href="classSetArguments.html#a551272d71c803f64efc155b04f41e775" title="End of the iterator for this set of arguments.">end</a>(); it++)
<a name="l00819"></a>00819                 result-&gt;<a class="code" href="classSetArguments.html#a989d8986ecf49baa0dc982766c0a5df4" title="Add an argument to the set.">add_Argument</a>(*it);
<a name="l00820"></a>00820         <span class="keywordflow">for</span> (<a class="code" href="classSetArgumentsIterator.html" title="Class defining a const iterator for the elements of a set of arguments.">SetArgumentsIterator</a> it= other-&gt;<a class="code" href="classSetArguments.html#aaee058feaed861edf27739fa04f374ef" title="Begin of the iterator for this set of arguments.">begin</a>(); it != other-&gt;<a class="code" href="classSetArguments.html#a551272d71c803f64efc155b04f41e775" title="End of the iterator for this set of arguments.">end</a>(); it++)
<a name="l00821"></a>00821                 result-&gt;<a class="code" href="classSetArguments.html#a989d8986ecf49baa0dc982766c0a5df4" title="Add an argument to the set.">add_Argument</a>(*it);
<a name="l00822"></a>00822 }
<a name="l00823"></a>00823 
<a name="l00825"></a><a class="code" href="classSetArguments.html#a26bbc586d96178dfc64ee0cdb7601564">00825</a> <span class="keywordtype">bool</span> <a class="code" href="classSetArguments.html#a26bbc586d96178dfc64ee0cdb7601564" title="restituisce TRUE sse nel grafo esiste almeno un arco orientato">SetArguments::graphHasEdges</a>(<span class="keywordtype">void</span>) {
<a name="l00826"></a>00826         <span class="comment">// ricerco l&#39;esistenza di almeno un nodo che sia attaccato &lt;=&gt; il grafo ha archi</span>
<a name="l00827"></a>00827         <a class="code" href="classSetArgumentsIterator.html" title="Class defining a const iterator for the elements of a set of arguments.">SetArgumentsIterator</a> it = this-&gt;<a class="code" href="classSetArguments.html#aaee058feaed861edf27739fa04f374ef" title="Begin of the iterator for this set of arguments.">begin</a>();
<a name="l00828"></a>00828         <span class="keywordtype">bool</span> edges = <span class="keyword">false</span>;
<a name="l00829"></a>00829         <span class="keywordflow">while</span> (!edges and it != this-&gt;<a class="code" href="classSetArguments.html#a551272d71c803f64efc155b04f41e775" title="End of the iterator for this set of arguments.">end</a>()) {
<a name="l00830"></a>00830                 <a class="code" href="classSetArguments.html" title="Class encompassing a set of arguments.">SetArguments</a>* attacked = (*it)-&gt;get_attacks();
<a name="l00831"></a>00831                 <span class="keywordflow">if</span> (!attacked-&gt;<a class="code" href="classSetArguments.html#a91e548daa6d0859946c8604b1ebb8c5a" title="Check wether or not this set is empty.">empty</a>())
<a name="l00832"></a>00832                         edges = <span class="keyword">true</span>;
<a name="l00833"></a>00833                 it++;
<a name="l00834"></a>00834         }
<a name="l00835"></a>00835         <span class="keywordflow">return</span> <span class="keyword">false</span>;
<a name="l00836"></a>00836 }
<a name="l00837"></a>00837 
<a name="l00898"></a><a class="code" href="classSetArguments.html#ae6761b6c360e440de55c2060ae70981c">00898</a> <span class="keywordtype">void</span> <a class="code" href="classSetArguments.html#ae6761b6c360e440de55c2060ae70981c" title="Intersect this set the `other` set and write the result in `res`.">SetArguments::intersect</a>(<a class="code" href="classSetArguments.html" title="Class encompassing a set of arguments.">SetArguments</a> *other, <a class="code" href="classSetArguments.html" title="Class encompassing a set of arguments.">SetArguments</a> *result) {
<a name="l00899"></a>00899 
<a name="l00900"></a>00900         <span class="keywordflow">for</span> (<a class="code" href="classSetArgumentsIterator.html" title="Class defining a const iterator for the elements of a set of arguments.">SetArgumentsIterator</a> it1 = this-&gt;<a class="code" href="classSetArguments.html#aaee058feaed861edf27739fa04f374ef" title="Begin of the iterator for this set of arguments.">begin</a>(); it1 != this-&gt;<a class="code" href="classSetArguments.html#a551272d71c803f64efc155b04f41e775" title="End of the iterator for this set of arguments.">end</a>(); it1++)
<a name="l00901"></a>00901                 <span class="keywordflow">for</span> (<a class="code" href="classSetArgumentsIterator.html" title="Class defining a const iterator for the elements of a set of arguments.">SetArgumentsIterator</a> it2 = other-&gt;<a class="code" href="classSetArguments.html#aaee058feaed861edf27739fa04f374ef" title="Begin of the iterator for this set of arguments.">begin</a>(); it2 != other-&gt;<a class="code" href="classSetArguments.html#a551272d71c803f64efc155b04f41e775" title="End of the iterator for this set of arguments.">end</a>(); it2++)
<a name="l00902"></a>00902                         <span class="keywordflow">if</span> (*(*it1) == *(*it2))
<a name="l00903"></a>00903                                 result-&gt;<a class="code" href="classSetArguments.html#a989d8986ecf49baa0dc982766c0a5df4" title="Add an argument to the set.">add_Argument</a>(*it1);
<a name="l00904"></a>00904 }
<a name="l00905"></a>00905 
<a name="l00919"></a><a class="code" href="classSetArguments.html#a0c4a6994f83dfccf2d34022cb132b782">00919</a> <span class="keywordtype">bool</span> <a class="code" href="classSetArguments.html#a0c4a6994f83dfccf2d34022cb132b782" title="verify that 2 SetArguments are equal">SetArguments::equal</a>(<span class="keyword">const</span> <a class="code" href="classSetArguments.html" title="Class encompassing a set of arguments.">SetArguments</a> &amp;other)<span class="keyword"> const</span>{
<a name="l00920"></a>00920         <span class="keywordflow">if</span> (this-&gt;<a class="code" href="classSetArguments.html#a66d5b1cc6b684700c2394a8cf62ef7f0" title="Retuns the cardinality of this set.">cardinality</a>()!=other.<a class="code" href="classSetArguments.html#a66d5b1cc6b684700c2394a8cf62ef7f0" title="Retuns the cardinality of this set.">cardinality</a>())
<a name="l00921"></a>00921                 <span class="keywordflow">return</span> <span class="keyword">false</span>;
<a name="l00922"></a>00922         <span class="keywordflow">for</span> (<span class="keyword">auto</span> it=this-&gt;<a class="code" href="classSetArguments.html#aaee058feaed861edf27739fa04f374ef" title="Begin of the iterator for this set of arguments.">begin</a>();it!=this-&gt;<a class="code" href="classSetArguments.html#a551272d71c803f64efc155b04f41e775" title="End of the iterator for this set of arguments.">end</a>(); it++)
<a name="l00923"></a>00923                 <span class="keywordflow">if</span> (other.<a class="code" href="classSetArguments.html#aaae0e0a7aeffe21d3ec1e0254f4bf364">arguments</a>.find((*it)-&gt;getName())==other.<a class="code" href="classSetArguments.html#aaae0e0a7aeffe21d3ec1e0254f4bf364">arguments</a>.end())
<a name="l00924"></a>00924                         <span class="keywordflow">return</span> <span class="keyword">false</span>;
<a name="l00925"></a>00925         <span class="keywordflow">return</span> <span class="keyword">true</span>;
<a name="l00926"></a>00926 }
<a name="l00927"></a>00927 
<a name="l00942"></a><a class="code" href="classSetArguments.html#a22ed014efa057dd385c5ea89b6de5e94">00942</a> <span class="keywordtype">bool</span> <a class="code" href="classSetArguments.html#a22ed014efa057dd385c5ea89b6de5e94">SetArguments::operator==</a>(<span class="keyword">const</span> <a class="code" href="classSetArguments.html" title="Class encompassing a set of arguments.">SetArguments</a> &amp;other)<span class="keyword"> const</span>
<a name="l00943"></a>00943 <span class="keyword"></span>{
<a name="l00944"></a>00944         <span class="keywordflow">if</span> (this-&gt;<a class="code" href="classSetArguments.html#a66d5b1cc6b684700c2394a8cf62ef7f0" title="Retuns the cardinality of this set.">cardinality</a>() != other.<a class="code" href="classSetArguments.html#a66d5b1cc6b684700c2394a8cf62ef7f0" title="Retuns the cardinality of this set.">cardinality</a>())
<a name="l00945"></a>00945                 <span class="keywordflow">return</span> <span class="keyword">false</span>;
<a name="l00946"></a>00946         <span class="keywordflow">for</span>(<a class="code" href="classSetArgumentsIterator.html" title="Class defining a const iterator for the elements of a set of arguments.">SetArgumentsIterator</a> it = this-&gt;<a class="code" href="classSetArguments.html#aaee058feaed861edf27739fa04f374ef" title="Begin of the iterator for this set of arguments.">begin</a>(), it2 = other.<a class="code" href="classSetArguments.html#aaee058feaed861edf27739fa04f374ef" title="Begin of the iterator for this set of arguments.">begin</a>(); it != this-&gt;<a class="code" href="classSetArguments.html#a551272d71c803f64efc155b04f41e775" title="End of the iterator for this set of arguments.">end</a>() and it2 != other.<a class="code" href="classSetArguments.html#aaee058feaed861edf27739fa04f374ef" title="Begin of the iterator for this set of arguments.">begin</a>(); it++, it2++)
<a name="l00947"></a>00947                 <span class="keywordflow">if</span> ((*it) != (*it2))
<a name="l00948"></a>00948                         <span class="keywordflow">return</span> <span class="keyword">false</span>;
<a name="l00949"></a>00949         <span class="keywordflow">return</span> <span class="keyword">true</span>;
<a name="l00950"></a>00950 }
<a name="l00951"></a>00951 
<a name="l00959"></a><a class="code" href="classSetArguments.html#ac5045a8ee2c6160b131f70b52e64112e">00959</a> <span class="keywordtype">bool</span> <a class="code" href="classSetArguments.html#ac5045a8ee2c6160b131f70b52e64112e" title="TRUE if the 2 SetArguments called are not equal using == operator.">SetArguments::operator!=</a>(<span class="keyword">const</span> <a class="code" href="classSetArguments.html" title="Class encompassing a set of arguments.">SetArguments</a> &amp;other)<span class="keyword"> const </span>{
<a name="l00960"></a>00960         <span class="keywordflow">return</span> !(*<span class="keyword">this</span>==other);
<a name="l00961"></a>00961 }
<a name="l00962"></a>00962 
<a name="l00971"></a><a class="code" href="classSetArguments.html#aff18fbe9d86a04099461245c780e52a5">00971</a> <a class="code" href="classSetArguments.html#aff18fbe9d86a04099461245c780e52a5">SetArguments::~SetArguments</a>(){
<a name="l00972"></a>00972         <span class="comment">//keyassoc: nothing to free because the structures pointed by keyassoc-&gt;second must remain intact</span>
<a name="l00973"></a>00973         <span class="comment">//arguments: nothing to free because the structures pointed by arguments-&gt;second muyst remain intact</span>
<a name="l00974"></a>00974 }
<a name="l00975"></a>00975 
<a name="l00986"></a><a class="code" href="classSetArguments.html#a0de309ba2427eb3dce2f8ca93bb078e4">00986</a> <span class="keywordtype">void</span> <a class="code" href="classSetArguments.html#a0de309ba2427eb3dce2f8ca93bb078e4" title="removes all the pointers of Arguments inside this set.">SetArguments::clean</a>() {
<a name="l00987"></a>00987         this-&gt;<a class="code" href="classSetArguments.html#a09a6ac57967a3eb26006fd1c61e8cf4a">remove_All_Arguments</a>();
<a name="l00988"></a>00988 }
<a name="l00989"></a>00989 
<a name="l00990"></a>00990 ostream&amp; <a class="code" href="Argument_8cpp.html#a76ef732a0021f3ac6698582cf94a079e">operator&lt;&lt;</a>(ostream&amp; out, <span class="keyword">const</span> <a class="code" href="classSetArguments.html" title="Class encompassing a set of arguments.">SetArguments</a>&amp; r)
<a name="l00991"></a>00991 {
<a name="l00992"></a>00992         out &lt;&lt; <span class="stringliteral">&quot;{&quot;</span>;
<a name="l00993"></a>00993         <a class="code" href="classSetArgumentsIterator.html" title="Class defining a const iterator for the elements of a set of arguments.">SetArgumentsIterator</a> it;
<a name="l00994"></a>00994         <span class="keywordflow">for</span> (it = r.<a class="code" href="classSetArguments.html#aaee058feaed861edf27739fa04f374ef" title="Begin of the iterator for this set of arguments.">begin</a>(); it != r.<a class="code" href="classSetArguments.html#a551272d71c803f64efc155b04f41e775" title="End of the iterator for this set of arguments.">end</a>();)
<a name="l00995"></a>00995         {
<a name="l00996"></a>00996                 out &lt;&lt; (*it)-&gt;<a class="code" href="classArgument.html#a95323c2bfcbb4c0d494acc13f76cc28a" title="Method returning the name of the argument.">getName</a>();
<a name="l00997"></a>00997                 <span class="keywordflow">if</span> (++it != r.<a class="code" href="classSetArguments.html#a551272d71c803f64efc155b04f41e775" title="End of the iterator for this set of arguments.">end</a>())
<a name="l00998"></a>00998                         out &lt;&lt; <span class="stringliteral">&quot; &quot;</span>;
<a name="l00999"></a>00999         }
<a name="l01000"></a>01000         out &lt;&lt; <span class="stringliteral">&quot;}&quot;</span>;
<a name="l01001"></a>01001         <span class="keywordflow">return</span> out;
<a name="l01002"></a>01002 }
<a name="l01003"></a>01003 
</pre></div></div><!-- contents -->
</div>
  <div id="nav-path" class="navpath">
    <ul>
      <li class="navelem"><a class="el" href="SetArguments_8cpp.html">SetArguments.cpp</a>      </li>

    <li class="footer">Generated on Fri Jan 17 2014 11:47:51 for SemOpt by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.6.1 </li>
   </ul>
 </div>


</body>
</html>
